<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
</head>
<body>
    <div class="app" v-text="message"></div>
    <div class="app1" v-html="html"></div>    
</body>
<script>
    var app = new Vue({
        el: '.app',
        data: {
            message: "v-text为组件添加文本，但值得注意的是，该方法会覆盖掉组件中的所有内容"
        } 
    })
    var app1 = new Vue({
        el:'.app1',
        data:{
            html:"<h1>我喜欢你</h1><h2>相当于js中的innerHTML</h2>"
        }
    })
</script>
</html>